<?
$counterfile = "counter.dat";
$opencount = @fopen($counterfile,"r");
$currentcount = fread($opencount, filesize($counterfile));
fclose($opencount);
$currentcount += 1;
$opencount = @fopen($counterfile,"w");
echo "opencount =  $opencount";
$flag = fwrite($opencount, $currentcount);
echo "flag =  $flag";
fclose ($opencount);
?>
